package com.chatroomdemo.mapper;

import com.chatroomdemo.model.Friend;
import com.chatroomdemo.model.MessageSession;
import com.chatroomdemo.model.MessageSessionUser;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface SessionMapper {
    //根据userId查找sessionId
    public List<Integer> selectSessionIdByUserId(Integer userId);

    //查找friendName与friendId，根据sessionId查找userId（friendId）（查找userId不等于用户的userId的userId）
    public List<Friend> selectFriendBySessionId(int sessionId,Integer userId);




    //新增会话记录
    Integer insertMessageSession(MessageSession messageSession);

    //给message_session_user添加记录
    void insertMessageSessionUser(MessageSessionUser messageSessionUser);
}
